/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package attendancecheckerserver;

import java.util.Date;
import java.util.Scanner;

/**
 *
 * @author hEllO
 */
public class serverUI extends javax.swing.JFrame {

    /**
     * Creates new form serverUI
     */
    public serverUI() {
        initComponents();
    }   

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        SubjectPanel = new javax.swing.JPanel();
        Subject = new javax.swing.JLabel();
        Classcode = new javax.swing.JLabel();
        Schedule = new javax.swing.JLabel();
        NoOfStudents = new javax.swing.JLabel();
        Date = new javax.swing.JLabel();
        subjectField = new javax.swing.JTextField();
        classcodeField = new javax.swing.JTextField();
        scheduleField = new javax.swing.JTextField();
        noOfStudentsField = new javax.swing.JTextField();
        dateField = new javax.swing.JTextField();
        StudentPanel = new javax.swing.JPanel();
        jScrollPane1 = new javax.swing.JScrollPane();
        StudentTable = new javax.swing.JTable();
        FileMenu = new javax.swing.JMenuBar();
        jMenu1 = new javax.swing.JMenu();
        newAttendanceMenu = new javax.swing.JMenuItem();
        openAttendanceMenu = new javax.swing.JMenuItem();
        jSeparator1 = new javax.swing.JPopupMenu.Separator();
        exitMenu = new javax.swing.JMenuItem();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("AttendanceChecker: Instuctor");
        setResizable(false);

        SubjectPanel.setBackground(new java.awt.Color(0, 51, 51));

        Subject.setForeground(new java.awt.Color(255, 255, 255));
        Subject.setText("Subject: ");

        Classcode.setForeground(new java.awt.Color(255, 255, 255));
        Classcode.setText("Classcode: ");

        Schedule.setForeground(new java.awt.Color(255, 255, 255));
        Schedule.setText("Schedule: ");

        NoOfStudents.setForeground(new java.awt.Color(255, 255, 255));
        NoOfStudents.setText("Number of Students:");

        Date.setForeground(new java.awt.Color(255, 255, 255));
        Date.setText("Date:");

        subjectField.setEditable(false);
        subjectField.setBackground(new java.awt.Color(0, 51, 51));
        subjectField.setForeground(new java.awt.Color(255, 255, 255));
        subjectField.setBorder(null);

        classcodeField.setBackground(new java.awt.Color(0, 51, 51));
        classcodeField.setForeground(new java.awt.Color(255, 255, 255));
        classcodeField.setBorder(null);

        scheduleField.setEditable(false);
        scheduleField.setBackground(new java.awt.Color(0, 51, 51));
        scheduleField.setBorder(null);

        noOfStudentsField.setEditable(false);
        noOfStudentsField.setBackground(new java.awt.Color(0, 51, 51));
        noOfStudentsField.setBorder(null);

        dateField.setEditable(false);
        dateField.setBackground(new java.awt.Color(0, 51, 51));
        dateField.setForeground(new java.awt.Color(255, 255, 255));
        dateField.setBorder(null);

        javax.swing.GroupLayout SubjectPanelLayout = new javax.swing.GroupLayout(SubjectPanel);
        SubjectPanel.setLayout(SubjectPanelLayout);
        SubjectPanelLayout.setHorizontalGroup(
            SubjectPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(SubjectPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(SubjectPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(SubjectPanelLayout.createSequentialGroup()
                        .addComponent(NoOfStudents)
                        .addGap(18, 18, 18)
                        .addComponent(noOfStudentsField, javax.swing.GroupLayout.DEFAULT_SIZE, 445, Short.MAX_VALUE))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, SubjectPanelLayout.createSequentialGroup()
                        .addComponent(Schedule)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(scheduleField))
                    .addGroup(SubjectPanelLayout.createSequentialGroup()
                        .addGroup(SubjectPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(Classcode)
                            .addComponent(Subject))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(SubjectPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                            .addComponent(subjectField, javax.swing.GroupLayout.DEFAULT_SIZE, 502, Short.MAX_VALUE)
                            .addGroup(SubjectPanelLayout.createSequentialGroup()
                                .addGap(47, 47, 47)
                                .addComponent(classcodeField)))))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 274, Short.MAX_VALUE)
                .addComponent(Date)
                .addGap(18, 18, 18)
                .addComponent(dateField, javax.swing.GroupLayout.PREFERRED_SIZE, 298, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        SubjectPanelLayout.setVerticalGroup(
            SubjectPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(SubjectPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(SubjectPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(Date)
                    .addComponent(subjectField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(dateField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(Classcode))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(SubjectPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(classcodeField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(Subject))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(SubjectPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(Schedule)
                    .addComponent(scheduleField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(SubjectPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(NoOfStudents)
                    .addComponent(noOfStudentsField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        StudentPanel.setBackground(new java.awt.Color(0, 51, 51));
        StudentPanel.setAlignmentX(0.0F);
        StudentPanel.setAlignmentY(0.0F);
        StudentPanel.setAutoscrolls(true);
        StudentPanel.setPreferredSize(new java.awt.Dimension(1200, 540));

        StudentTable.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, "", null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null, null}
            },
            new String [] {
                "ID Number", "Name", "Terminal No.", "No. of Absences", "No. of Tardiness", "Remarks", "Time-in", "Current Status"
            }
        ) {
            boolean[] canEdit = new boolean [] {
                false, false, false, false, false, false, false, false
            };

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        StudentTable.setColumnSelectionAllowed(true);
        jScrollPane1.setViewportView(StudentTable);
        StudentTable.getColumnModel().getSelectionModel().setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
        StudentTable.getColumnModel().getColumn(0).setResizable(false);
        StudentTable.getColumnModel().getColumn(2).setResizable(false);
        StudentTable.getColumnModel().getColumn(3).setResizable(false);
        StudentTable.getColumnModel().getColumn(4).setResizable(false);
        StudentTable.getColumnModel().getColumn(5).setResizable(false);
        StudentTable.getColumnModel().getColumn(6).setResizable(false);
        StudentTable.getColumnModel().getColumn(7).setResizable(false);

        javax.swing.GroupLayout StudentPanelLayout = new javax.swing.GroupLayout(StudentPanel);
        StudentPanel.setLayout(StudentPanelLayout);
        StudentPanelLayout.setHorizontalGroup(
            StudentPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 0, Short.MAX_VALUE)
            .addGroup(StudentPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(StudentPanelLayout.createSequentialGroup()
                    .addContainerGap()
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 1180, Short.MAX_VALUE)
                    .addContainerGap()))
        );
        StudentPanelLayout.setVerticalGroup(
            StudentPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 552, Short.MAX_VALUE)
            .addGroup(StudentPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(StudentPanelLayout.createSequentialGroup()
                    .addContainerGap()
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 530, Short.MAX_VALUE)
                    .addContainerGap()))
        );

        FileMenu.setBorder(null);

        jMenu1.setText("File");

        newAttendanceMenu.setText("New Attendance...");
        newAttendanceMenu.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                newAttendanceMenuActionPerformed(evt);
            }
        });
        jMenu1.add(newAttendanceMenu);

        openAttendanceMenu.setText("Open Attendance...");
        openAttendanceMenu.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                openAttendanceMenuActionPerformed(evt);
            }
        });
        jMenu1.add(openAttendanceMenu);
        jMenu1.add(jSeparator1);

        exitMenu.setText("Exit");
        exitMenu.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                exitMenuActionPerformed(evt);
            }
        });
        jMenu1.add(exitMenu);

        FileMenu.add(jMenu1);

        setJMenuBar(FileMenu);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(SubjectPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(StudentPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(SubjectPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(StudentPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 552, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void newAttendanceMenuActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_newAttendanceMenuActionPerformed
	newAttendance newA = new newAttendance();
	newA.setVisible(true);
    }//GEN-LAST:event_newAttendanceMenuActionPerformed

    private void openAttendanceMenuActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_openAttendanceMenuActionPerformed
	openAttendance open = new openAttendance();
	open.setVisible(true);
    }//GEN-LAST:event_openAttendanceMenuActionPerformed

    private void exitMenuActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_exitMenuActionPerformed
	System.exit(0);
    }//GEN-LAST:event_exitMenuActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(serverUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            @Override
            public void run() {
                new serverUI().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel Classcode;
    private javax.swing.JLabel Date;
    private javax.swing.JMenuBar FileMenu;
    private javax.swing.JLabel NoOfStudents;
    private javax.swing.JLabel Schedule;
    private javax.swing.JPanel StudentPanel;
    private javax.swing.JTable StudentTable;
    private javax.swing.JLabel Subject;
    private javax.swing.JPanel SubjectPanel;
    private javax.swing.JTextField classcodeField;
    private javax.swing.JTextField dateField;
    private javax.swing.JMenuItem exitMenu;
    private javax.swing.JMenu jMenu1;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JPopupMenu.Separator jSeparator1;
    private javax.swing.JMenuItem newAttendanceMenu;
    private javax.swing.JTextField noOfStudentsField;
    private javax.swing.JMenuItem openAttendanceMenu;
    private javax.swing.JTextField scheduleField;
    private javax.swing.JTextField subjectField;
    // End of variables declaration//GEN-END:variables

    private String subjectStr;
    private String classcodeStr;
    private String scheduleStr;
    private int noOfStudentsint;
    private String dateStr;
}
